import Vue from 'vue'
import VueRouter from "vue-router";
import Home from '../pages/home'
import Login from '@/pages/login'
import Register from '@/pages/register'
import Search from '@/pages/search'
import Shopcart from '@/pages/shopcart'
import Product from '@/pages/product'
import Detail from '@/pages/detail'
import Pay from '@/pages/pay'
import Order from '@/pages/order'

Vue.use(VueRouter)
export default new VueRouter({
    routes: [
        {
            path: '/',
            redirect: "/home",
            meta: { show: true }
        },
        {
            path: '/home',
            name: Home,
            component: Home,
            meta: { show: true }
        },
        {
            path: '/login',
            name: Login,
            component: Login,
            meta: { show: false }
        },
        {
            path: '/register',
            name: Register,
            component: Register,
            meta: { show: false }
        },
        {
            path: '/search',
            name: Search,
            component: Search,
            meta: { show: false }
        },

        {
            path: '/shopcart',
            name: Shopcart,
            component: Shopcart,
            meta: { show: false }
        },
        {
            path: '/product',
            name: Product,
            component: Product,
            meta: { show: false }
        },
        {
            path: '/detail',
            name: Detail,
            component: Detail,
            meta: { show: false }
        },
        {
            path: '/pay',
            name: Pay,
            component: Pay,
            meta: { show: false }
        },
        {
            path: '/order',
            name: Order,
            component: Order,
            meta: { show: true }
        },

    ]
})